﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using OfficeOpenXml;

namespace InspectionMAC.Function
{
    class SaveExcelInfo
    {
        public static void AddExcel()
        {
            ExcelPackage.LicenseContext = LicenseContext.Commercial;

            // 创建一个新的ExcelPackage
            var package = new ExcelPackage();

            // 添加一个新的工作簿
            var worksheet = package.Workbook.Worksheets.Add("我的工作表");

            // 在A1单元格写入“Hello, EPPlus!”
            worksheet.Cells["A1"].Value = "Hello, EPPlus!";

            // 保存工作簿到文件
            FileInfo fileInfo = new FileInfo("EPPlusExample.xlsx");
            package.SaveAs(fileInfo);
        }

    }
}
